#ifndef PATH_ITERATOR_H_
#define PATH_ITERATOR_H_

#include <list>
#include "path.h"
#include "point.h"
#include "ifollower.h"
#include "pathInfo.h"
#include "pathData.h"


class PathIterator{
	protected:
		Path::iterator initial;
		Path::iterator last;
		Point current;

		bool _loop;
		bool _begin;
		bool _end;

		unsigned int count;
		unsigned int newStep;
		unsigned int step;

		std::list<IFollower*> followers;

		Path& path;
	public:
		PathIterator(Path& path,unsigned int step,bool loop);
		virtual ~PathIterator();

		Point getCurrent()const;
		PathData getInitial()const;
		PathData getLast()const;

		void setNewStep(unsigned int delta_step);

		virtual PathIterator& operator ++();
		virtual PathIterator& operator --();

		bool loop(){ return _loop; }
		bool end(){ return _end; }
		bool begin(){ return _begin; }

		void addFollower(IFollower* follower);
		void removeFollower(IFollower* follower);
	private:
		void updateFollowers();
};


#endif /* PATH_ITERATOR_H_ */
